import ListDone from "../carousel/swiper/list.js";
import LStorage from './localtion.js';
new LStorage()
class Detail {
    elem;
    parent;
    constructor(){
        this.parent=document.querySelector('.recommend3')      
         window.addEventListener('load',e=>this.loadHandler(e))
    }
  async loadHandler(e){
        var s=window.location.href.split('?')[1]
        s=decodeURI(s)
        console.log(s);
        var data=  await fetch('http://localhost:4020/changeData',{method:'post',body:JSON.stringify(s)});  
        data = await data.json()  
        data = data.result ;
        console.log(data);
        data.forEach(item=>{
            item.skuList = JSON.parse(item.skuList)
        })
        new ListDone(this.parent,data)
    }    
}

new Detail()